/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-05-22
 * Time: 21:08
 */
public class Test1 {
    public static void main(String[] args) {
        //使用常量串构造
        String s1 = "hi new classmate";
        System.out.println(s1);
        //直接new String对象
        String s2 = new String("hi new classmate");
        System.out.println(s2);
        //使用字符数组进行构造
        char[] array = {'h','i'};
        String s3 = new String(array);
        System.out.println(s2);
    }
}
